/**  
 * @Title: ConfigurationExample.java  
 * @Package com.blog4java.mybatis.configuration  
 * @Description: TODO(用一句话描述该文件做什么)  
 * @author suyuhao  
 * @date 2025-05-28 07:40:01   
 */
package com.blog4java.mybatis.configuration;

import java.io.IOException;
import java.io.Reader;

import org.apache.ibatis.builder.xml.XMLConfigBuilder;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.Configuration;
import org.junit.Test;

/**  
* @ClassName: ConfigurationExample  
* @Description: 通过XMLConfigBuilder类创建Configuration的案例 
* @author suyuhao  
* @date 2025-05-28 07:40:01
*/
public class ConfigurationExample {
    @Test
    public void testConfiguration() throws IOException {
        Reader reader = Resources.getResourceAsReader("mybatis-config.xml");
        // 创建XMLConfigBuilder实例
        XMLConfigBuilder builder = new XMLConfigBuilder(reader);
        // 调用XMLConfigBuilder.parse()方法，解析XML创建Configuration对象
        Configuration conf = builder.parse();
    }
}
